<%-- 
    Document   : view
    Created on : Mar 8, 2010, 10:49:03 AM
    Author     : Jagadeesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*" %>
<%@page import="model.Koperasi" %>
<%@page import="database.DBClass"%>
<%@page import="validation.ValidateForm"%>
<%@ page import ="java.sql.*" %>
<%
    if (session.getAttribute("akun") == null) {
        response.sendRedirect(request.getContextPath() + "/admin/login.jsp");
    }

%>
<html>
    <head>
        <style type="text/css">
            body {
                background-color:black;
                background-image:url(images/4.jpg); 
            }
        </style>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap.css" rel="stylesheet"> 
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap-responsive.css" rel="stylesheet">

        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.min.js"></script>
        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.widget.min.js"></script>

        <script src="<%request.getContextPath();%>/E-Stonion/js/metro/metro-*.js"></script>
        <title>View Koperasi Page</title>
    </head>
    <body class="metro">
    <nav class="navigation-bar">
        <nav class="navigation-bar-content">
                <a class="element" href="/E-Stonion/home.jsp">
                    <span class="icon-grid-view"></span>
                    E-Stonion </a>


            <span class="element-divider"></span>
            <a class="element" href="viewproduk">View Produk</a>
            <a class="element" href="insertproduk">Insert Produk</a>
            <a class="element" href="viewkoperasi">View Koperasi</a>
            <a class="element" href="insertkoperasi">Insert Koperasi</a>
            <span class="element-divider"></span>
            <a class="element place-right" href="LoginServlet?action=logout">Logout</a>
            <span class="element-divider place-right"></span>
        </nav>
    </nav> 

    <table width="100%"border="1" class="table table-striped">
        <tr>
            <th>ID Koperasi</th>
            <th>Nama Koperasi</th>
            <th>Alamat Koperasi</th>
            <th>Kota Koperasi</th>
            <th>Deskripsi Koperasi</th>
            <th>No Telp Koperasi</th>
            <th>action</th>
        </tr>
        <%
            Koperasi kop = new Koperasi();
            DBClass dbobject = new DBClass();
            List list = dbobject.getAllkoperasi();
            //                request.setAttribute("list", list);
            //                List list2 = (List) request.getAttribute("list");
            if (list != null) {
                for (int i = 0; i < list.size(); i++) {
                    Koperasi ukop = (Koperasi) list.get(i);

        %>
        <tr>
            <td><%=ukop.getidkoperasi()%></td>
            <td><%=ukop.getnamakoperasi()%></td>
            <td><%=ukop.getalamatkoperasi()%></td>
            <td><%=ukop.getKota()%></td>
            <td><%=ukop.getdeskripsikoperasi()%></td>
            <td><%=ukop.getnotelpkoperasi()%></td>
            <td><a href="ControllerServletk?actionk=editkoperasi&idkoperasi=<%=ukop.getidkoperasi()%>">update</a>
                |
                <a href="ControllerServletk?actionk=deletekoperasi&idkoperasi=<%=ukop.getidkoperasi()%>">delete</a>
        </tr>
        <%
                }
            }
        %>
    </table>
</body>
</html>
